 //const base_url = 'http://192.168.2.12:8764' //本地
const base_url = 'https://q.szzn.group'  //生产

export function request(url, data, method){
	return new Promise((resolve,reject)=>{
			uni.request({
				url: base_url+url,
				data,
				method: method || 'GET',
				header: {
					'Content-type': 'application/json',
					"authorization": uni.getStorageSync('Tokens') //这里的token指的是微信授权登录的token，用来判断小程序是否属于登录状态
				},
				dataType:'json',
				success:res => {
					if(res.data.code !== 0){
					}
					resolve(res)
				},
				fail:err => {
					console.log('err',err)
					reject(err)
				}
			});
		// }
		
	})
}
